<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../share/taglib.jsp" %>
<html>
<head>
<title><bean:message key="display.${houseForm.method eq 'edit' ? 'edit' : 'add' }"/><bean:message key="info.house.name"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/vip.css" type="text/css">
<%@ include file="/sks/cms/page/share/validate.inc" %>
<%@ include file="/sks/js/datePicker.inc" %>
<script type="text/javascript" src="/js/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="/js/jscripts/tiny_mce/button_style/simple.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init(getSimpleButtonStyle("rentShareInfo"));

$(function() {
	$( "#indate" ).datepicker({
		changeMonth: true,
		changeYear: true
	});
});
</script>
<html:javascript formName="houseForm"/>
<script type="text/javascript">
function bodyOnLoad() {
	tt.vf.req.add();
	tt.vf.int.add("salePrice", "rentPrice");
	new tt.LV().set(0, 100).add("houseProperty");
	new tt.LV().set(0, 40).add("linkMan", "mobile");
	new tt.NRV().set(0, '++').add("rentPrice", "salePrice");//'++'表示无穷大
	new tt.DV().set("yyyy-mm-dd").add("indate");
	${houseForm.method eq 'edit' ? 'tt.validate();' : ''}
}
function changeRentMode() {
	if (document.getElementById('rentMode').value == '1' || document.getElementById('rentMode').value == '2') {
		document.getElementById('rentShareInfoTr').style.display = '';
	} else {
		document.getElementById('rentShareInfoTr').style.display = 'none';
	}
}
</script>
</head>
<body onload="bodyOnLoad();" bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<html:form styleId="houseForm" action="/cms/house.do" method="post" onsubmit="return tt.validate();">
<html:hidden property="houseId"/>
<html:hidden property="title"/>
<html:hidden property="address" value="-"/>
<html:hidden property="space" value="0"/>
<html:hidden property="type"/>
<input type="hidden" name="method" value="${houseForm.method}">
  <table width="90%" border="0" cellspacing="2" cellpadding="3" align="center">
    <tr bgcolor="#ffbe26">
    	<td colspan="2">
    		<%@ include file="houseMenu.inc"%>
    	</td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td width="20%"><div align="right">房源标题：</div></td>
      <td width="80%" valign="middle">
      	${houseForm.title}
      </td>
    </tr>
    <!-- ################## 交易信息 ######################### -->
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">房屋产权：</div></td>
      <td valign="middle"><html:text disabled="<%=isReadOnly%>" property="houseProperty" size="50"/>
        <html:errors property="houseProperty"/>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">有效日期至：</div></td>
      <td valign="middle">
        <input name="indate" id="indate" <%=isReadOnly ? "disabled='disabled'" : ""%>
              value="<fmt:formatDate value='${houseForm.indate}' pattern='yyyy-MM-dd' />" />
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">联系人：</div></td>
      <td valign="middle"><html:text disabled="<%=isReadOnly%>" property="linkMan" size="50"/>
        <html:errors property="linkMan"/>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">联系电话：</div></td>
      <td valign="middle"><html:text disabled="<%=isReadOnly%>" property="mobile" size="50"/>
        <html:errors property="mobile"/>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">交易类型：</div></td>
      <td>
      	<html:select disabled="<%=isReadOnly%>" property="transaStatus">
      		<html:option value="0"><bean:message key="info.house.transaction.status0"/></html:option>
      		<html:option value="1"><bean:message key="info.house.transaction.status1"/></html:option>
      		<html:option value="2"><bean:message key="info.house.transaction.status2"/></html:option>
      	</html:select>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">租金(每月)：</div></td>
      <td valign="middle"><html:text disabled="<%=isReadOnly%>" property="rentPrice" size="50" maxlength="40"/>
        <html:errors property="rentPrice"/>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">租金支付方式：</div></td>
      <td>
      	<html:select disabled="<%=isReadOnly%>" property="rentPayTypeId">
      		<html:option value="-"></html:option>
      		<html:options collection="rpts" property="payTypeId" labelProperty="name"/>
      	</html:select>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">出租方式：</div></td>
      <td>
      	<html:select disabled="<%=isReadOnly%>" styleId="rentMode" property="rentMode" onchange="changeRentMode();">
      		<html:option value="-"></html:option>
      		<html:option value="0"><bean:message key="info.house.rentMode0"/></html:option>
      		<html:option value="1"><bean:message key="info.house.rentMode1"/></html:option>
      		<html:option value="2"><bean:message key="info.house.rentMode2"/></html:option>
      	</html:select>
      </td>
    </tr>
    <tr bgcolor="f5f5f5" id="rentShareInfoTr" style="display: ${houseForm.rentMode == 1 || houseForm.rentMode == 2 ? '' : 'none'}"> 
      <td><div align="right">合租要求：</div></td>
      <td valign="middle">
        <html:textarea property="rentShareInfo" styleId="rentShareInfo"></html:textarea>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">出售价格(每平方米)：</div></td>
      <td valign="middle"><html:text disabled="<%=isReadOnly%>" property="salePrice" size="50"/>
        <html:errors property="salePrice"/>
      </td>
    </tr>
    <tr bgcolor="f5f5f5"> 
      <td><div align="right">买卖支付方式：</div></td>
      <td>
      	<html:select disabled="<%=isReadOnly%>" property="salePayTypeId">
      		<html:option value="-"></html:option>
      		<html:options collection="spts" property="payTypeId" labelProperty="name"/>
      	</html:select>
      </td>
    </tr>
    <!-- ################## 交易信息 ######################### -->
    <tr bgcolor="f5f5f5"> 
      <td colspan="2"><div align="center"> 
          <button <%=isReadOnly ? "disabled='disabled'" : ""%> type="submit" class="frm_btn">保&nbsp;&nbsp;存</button>
      </div></td>
    </tr>
  </table>
</html:form>
<br>
</body>
</html>